From: Øyvind Kolås Date: Thu, 6 Dec 2018 16:06:28 +0000 (+0100) Subject: babl: special case palette formats in babl_format_with_space X-Git-Tag: archive/raspbian/1%0.1.106-3+rpi1^2~15^2~12^2~16 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e6fd9d4471349476b106374b81fc0655e090486b;p=babl.git babl: special case palette formats in babl_format_with_space For now, re-return the original passed in format, this will as a starter not crash - while the color management is non-functional; the special casing will be made more elaborate with space support in babl-palette. --- diff --git a/babl/babl-format.c b/babl/babl-format.c index 7b81cae..e532417 100644 --- a/babl/babl-format.c +++ b/babl/babl-format.c @@ -727,6 +727,13 @@ babl_format_with_space (const char *encoding, const Babl *space) if (BABL_IS_BABL (example_format)) { + if (babl_format_is_palette (example_format)) + { + /* XXX we should allocate a new palette name, and + duplicate the path data, converted for new space + */ + return example_format; + } encoding = babl_get_name (example_format); if (babl_format_get_space (example_format) != babl_space ("sRGB")) {